MailItem.BodyFormat 属性 (Outlook) 您所在的位置:网站首页 vba merge 属性 MailItem.BodyFormat 属性 (Outlook)

MailItem.BodyFormat 属性 (Outlook)

2024-03-10 00:48| 来源: 网络整理| 查看: 265

MailItem.BodyFormat 属性 (Outlook) 项目 04/07/2023

返回或设置一个 OlBodyFormat 常量,该常量指示正文文本的格式。 读/写。

语法

expression。 BodyFormat

expression 表示 MailItem 对象的变量。

备注

正文文本格式决定用于显示邮件文本的标准。 Microsoft Outlook 提供了三个正文文本格式选项:纯文本、RTF 和 HTML。

BodyFormat 属性从 RTF 切换到 HTML,反之亦然,所有文本格式都将丢失。

示例

下面的 Microsoft Visual Basic for Applications (VBA) 示例创建一个新的 MailItem 对象,并将 BodyFormat 属性设置为 olFormatHTML 。 电子邮件项目的正文文本现在将以 HTML 格式显示。

Sub CreateHTMLMail() 'Creates a new email item and modifies its properties. Dim objMail As MailItem 'Create mail item Set objMail = Application.CreateItem(olMailItem) With objMail 'Set body format to HTML .BodyFormat = olFormatHTML .HTMLBody = "The body of this message will appear in HTML.Type the message text here. " .Display End With End Sub 另请参阅

MailItem 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有